﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataExtractionLanguage
{
    /// <summary>
    /// Reporting class is used to report error and warnings to the user.
    /// </summary>
    public class Report
    {
        public List<ErrorInfo> ErrorsReport { get; set; }

        public void Error(Location location, TokenTypeEnum token, object tokenValue, params string[] expecting)
        {
            ErrorsReport.Add(new ErrorInfo { Row = location.Row, Col = location.Col, ErrorValue = tokenValue, ErrorType = "Parsing", Message = string.Format("{0} expected", string.Join(", ", expecting)) });
            throw new Exception("Error");
        }

        public void Error(string p, string p_2)
        {
            throw new NotImplementedException();
        }

        public Report()
        {
            ErrorsReport = new List<ErrorInfo>();
        }
    }

    public class ErrorInfo
    {
        public int Row { get; set; }
        public int Col { get; set; }
        public object ErrorValue { get; set; }
        public string Message { get; set; }
        public string ErrorType { get; set; }
    }
}
